<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>查看大图</title>
		<!--<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">-->
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=3.0, user-scalable=yes"/>
		<meta name="HandheldFriendly" content="true"/>
		<meta name="MobileOptimized" content="320"/>
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<style>
			html {
				width: 100%;
				height: 100%;
			}
			body {
				margin: 0;
				padding: 0;
				width: 100%;
				height: 100%;
				font-family: Arial;
				font-size:16px;
				color: #6c6c6c;
				-webkit-touch-callout:none;
				-webkit-tap-highlight-color:rgba(0,0,0,0);
				-webkit-text-size-adjust:none;
			}
		</style>
	</head>

	<body style="text-align:center;background:#000000;">
		<img id="img" src="" style="vertical-align: middle;">
	</body>
	<script src="../../lib/mui/mui.js"></script>
	<script src="../../lib/framework/z-app.js"></script>
	<script>
		App.go({
			events : {
				keys : {
					back : function(e) {
						mui.back();
					}
				},
				gesture : {
					swiperight : function(e) {
//						mui.back();
					}
				}
			},
			appReady : function() {
				var styledata=plus.webview.currentWebview().getStyle();
				var path = styledata.path;
				var img=document.getElementById("img");
				img.src=path;
				img.onload=function(){
					var b = document.body;
					var img = document.getElementById("img");
					var pb = b.clientHeight/b.clientWidth,
					pi = img.clientHeight/img.clientWidth;
					if ( pb > pi ) {
						img.style.width = "100%";
					} else {
						img.style.height = "100%";
					}
					b.style.lineHeight = b.clientHeight+"px";
				}
				
				//点击一下回退
				img.addEventListener("tap",function(){
					if (!App.firsttap) {
						App.firsttap = new Date().getTime();
						setTimeout(function() {
							if(!App.secondtap){
								App.firsttap=null;
								mui.back();
							}else{
								App.firsttap=null;
								App.secondtap=null;
							}
						}, 300); 
					} else {
						App.secondtap=new Date().getTime();
					}
				});
			}
		});
	</script>
</html>